Use the If Activity
Note: Use caution when building or editing a workflow. For further advice or to arrange training, contact your professional services consultant.
The If activity is a branching action that can be used to specify a condition where the outcome is either true or false.
The If activity is located in the Control Flow section of the Microsoft Toolbox.
Note: The minimum requirement for the If activity is Condition.
The If activity consists of the following properties.
Section | This field | Holds this information... |
---|---|---|
Misc | Condition |
The Visual Basic (VB) expression where the outcome is either true or false. |
DisplayName |
The title of the activity. Note: The DisplayName property is set to If by default. |
|
Then | The activity triggered if the condition is true. | |
Else | The activity triggered if the condition is false. |
Clicking the ellipsis button adjacent to the relevant field opens the Expression Editor, where you can enter the relevant code in the Visual Basic (VB) format.
To add an If activity to a workflow:
-
Click the Microsoft Toolbox tab in the Activity section of Workflow Builder.
-
Drag and drop the If activity into the desired location within the Sequence panel.
Note: You can use the DisplayName to set a title for the If activity, set to If by default.
-
Type a condition that must be met in the Condition field and add a name for the activity to the DisplayName field.
Click the ellipsis button adjacent to either field to open the Expression Editor.
Note: An exclamation mark symbol indicates a warning. Refer to Use the Warnings Panel for further information.
-
Drag and drop the activity to be triggered (for example: Assign) if the condition is true into the Then section of the If activity window.
Edit the Then activity as required.
Note: If your workflow requires multiple activities you can use the Sequence control flow. Drag and drop Sequence into either Then or Else path. Once added, further activities can be included in the sequence.
-
Drag and drop the activity to be triggered if the condition is false into the Else section of the If activity window.
For example, drag an Assign activity into the Else section.
Edit the Else activity as required.
Note: An exclamation mark symbol indicates a warning. Refer to Use the Warnings Panel for further information.
- Click Save.